home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML Instance.sea / XML Instance / Required / plugins / HTMLWindow.jar / horst / FrameSetPanel.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-03-18  |  1.5 KB  |  62 lines

  1. package horst;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.util.Vector;
  6. import javax.swing.JPanel;
  7.  
  8. public class FrameSetPanel extends JPanel {
  9.    FrameSplitterBar[] bars;
  10.  
  11.    void doConstraintLayout() {
  12.       ((FrameSetLayout)((Container)this).getLayout()).doConstraintLayout();
  13.    }
  14.  
  15.    private FrameSplitterBar[] getBars() {
  16.       Vector temp = new Vector();
  17.       Component[] comps = ((Container)this).getComponents();
  18.  
  19.       for(int i = 0; i < comps.length; ++i) {
  20.          if (comps[i] instanceof FrameSplitterBar) {
  21.             temp.addElement(comps[i]);
  22.          }
  23.       }
  24.  
  25.       FrameSplitterBar[] bars = new FrameSplitterBar[temp.size()];
  26.       temp.copyInto(bars);
  27.       return bars;
  28.    }
  29.  
  30.    FrameSplitterBar getLeftSplitBar(FrameSplitterBar target) {
  31.       FrameSplitterBar[] bars = this.getBars();
  32.  
  33.       for(int i = 0; i < bars.length; ++i) {
  34.          if (bars[i] == target) {
  35.             if (i > 0) {
  36.                return bars[i - 1];
  37.             }
  38.  
  39.             return null;
  40.          }
  41.       }
  42.  
  43.       return null;
  44.    }
  45.  
  46.    FrameSplitterBar getRightSplitBar(FrameSplitterBar target) {
  47.       FrameSplitterBar[] bars = this.getBars();
  48.  
  49.       for(int i = 0; i < bars.length; ++i) {
  50.          if (bars[i] == target) {
  51.             if (i + 1 < bars.length) {
  52.                return bars[i + 1];
  53.             }
  54.  
  55.             return null;
  56.          }
  57.       }
  58.  
  59.       return null;
  60.    }
  61. }
  62.